/**
  ****************************(C) COPYRIGHT 2019 DJI****************************
  * @file       IST8310driver_middleware.c/h
  * @brief      the file provide I2C write/read function, as the middleware of IST8310.
  *             本文件主要提供I2C 读写函数，作为IST8310驱动的中间件
  * @note       IST8310 only support I2C. IST8310只支持I2C。
  * @history
  *  Version    Date            Author          Modification
  *  V1.0.0     Dec-26-2018     RM              1. done
  *
  @verbatim
  ==============================================================================

  ==============================================================================
  @endverbatim
  ****************************(C) COPYRIGHT 2019 DJI****************************
  */
#ifndef IST8310DRIVER_MIDDLEWARE_H
#define IST8310DRIVER_MIDDLEWARE_H

#include "i2c.h"
#include "main.h"
#include "gpio.h"
#define IST8310_IIC_ADDRESS 0x0E  //the I2C address of IST8310


uint8_t ist8310_IIC_read_single_reg(uint8_t reg);
void ist8310_IIC_write_single_reg(uint8_t reg, uint8_t data);


void ist8310_IIC_read_muli_reg(uint8_t reg, uint8_t *buf, uint8_t len);
void ist8310_IIC_write_muli_reg(uint8_t reg, uint8_t *data, uint8_t len);

void ist8310_delay_ms(uint16_t ms);

void ist8310_delay_us(uint16_t us);

void ist8310_RST_H(void);
void ist8310_RST_L(void);

#endif
